@import './theme/default.less';
@normalcolor: @theme-stroke-1;
@graycolor: @theme-stroke-4;
@theme-stroke-10color: @theme-stroke-10;
@darkgraycolor: @theme-stroke-3;
@bordercolor: @theme-stroke-7;
@rgbamaskbgcolor: @theme-mask-black-6;
@zIndex: 1050;

/*
  WARNING: Do NOT use transform: translate(-50%, -50%) to center dialog, it makes content blurry.

  With GPU rendering elements we are translating must be even numbers.
  The bad news is that we cannot control the size of dialogs.

  http://stackoverflow.com/questions/6411361/webkit-based-blurry-distorted-text-post-animation-via-translate3d

  Here we're using inline-blocks to center the dialog.

  https://css-tricks.com/centering-in-the-unknown/
*/

.zent-dialog-r-wrap {
  position: fixed;
  overflow: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: @zIndex;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  text-align: center;
  font-size: 0;
  white-space: nowrap;

  &::before {
    content: '';
    height: 100%;
    display: inline-block;
    vertical-align: middle; /* required */
  }
}

.zent-dialog-r {
  position: relative;
  display: inline-block;
  vertical-align: middle; /* required */
  text-align: initial;
  background-color: @theme-stroke-10color;
  border-radius: 4px;
  padding: 20px;
  box-sizing: border-box;
  font-size: 14px;
  white-space: normal;
}

.zent-dialog-r-title {
  padding-bottom: 10px;
  border-bottom: 1px solid @bordercolor;
  margin: 0;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.zent-dialog-r-title-text {
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
  color: @normalcolor;
}

.zent-dialog-r-close {
  position: absolute;
  display: inline-block;
  top: 4px;
  right: 10px;
  color: @graycolor;
  font-size: 20px;
  line-height: 20px;
  text-align: right;
  vertical-align: middle;
  cursor: pointer;
  border: none;
  background-color: @theme-stroke-10color;
  outline: none;
  user-select: none;
  padding: 0 6px;
  margin: 0;

  &:link,
  &:active,
  &:focus {
    color: @graycolor;
  }

  &.zent-dialog-r-has-title {
    top: 14px;
    right: 12px;
  }
}

.zent-dialog-r-body {
  color: @darkgraycolor;

  &.with-success-icon,
  &.with-warning-icon {
    padding-left: 30px;
  }
}

.zent-dialog-r-footer {
  text-align: right;
  margin-top: 30px;
}

.zent-dialog-r-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: @rgbamaskbgcolor;
  height: 100%;
  z-index: @zIndex;
}
